//
//  STDiskCacheKey+Ext.swift
//  StarTimesON
//
//  Created by Toj on 2/22/23.
//  Copyright © 2023 StarTimes. All rights reserved.
//

import Foundation

// MARK: - 缓存Key
private let PersistenceKey = "Persistence"
extension STDiskCacheKey {
    
    /* 预缓存激励广告数据 */
    /// 预缓存开屏广告UnitID
    static let preloadCacheAdJsonAppOpen = STDiskCacheKey(rawValue: "preloadCacheAdJsonAppOpen")
    /// 预缓存激励广告UnitID
    static let preloadCacheAdJsonReward = STDiskCacheKey(rawValue: "preloadCacheAdJsonReward")
    
    /// 插页广告 触发过次数
    static let interstitialAdTriggerCount = STDiskCacheKey(rawValue: "interstitialAdTriggerCount")
    /// 插页广告 时间间隔
    static let interstitialAdTriggerTime = STDiskCacheKey(rawValue: "interstitialAdTriggerTime")
   
    /// 缓存商品
    static var OTTProducts: STDiskCacheKey {
        let countryId = STUserCenter.default.countryId
        let rvalue = "ott-products-" + String(countryId)
        return STDiskCacheKey(rawValue: rvalue)
    }
    
    /// 缓存商品流量包
    static var OTTProductDataPackage: STDiskCacheKey {
        let countryId = STUserCenter.default.countryId
        let rvalue = "ott-product-dataPackage-" + String(countryId)
        print("-->toj: OTTProducts:\(rvalue)")
        return STDiskCacheKey(rawValue: rvalue)
    }
    
    /// 激励广告自动播放
    static let rewardAdAutoPlay = STDiskCacheKey(rawValue: "rewardAdAutoPlay")
    
    static func custom(string key: String) -> STDiskCacheKey {
        return STDiskCacheKey(rawValue: key)
    }
}
